package cn.edu.zut.hhr.service;

import cn.edu.zut.hhr.entity.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

@Service
@FeignClient(value = "${spring.application.name}",fallbackFactory = DeptServiceClientFallbackFactory.class)
public interface DeptService {
//getMapping里的值是访问的服务器端对应方法的请求路径
    @GetMapping("/dept/{id}")
    @ResponseBody
    Dept getById(@PathVariable("id") long id);

}
